package com.yida.gwj.expend.outside.domain.message;

import java.time.LocalDateTime;

import com.yida.common.core.exception.ServiceException;
import com.yida.gwj.common.utils.GwjEnumUtils;
import com.yida.gwj.expend.outside.enums.MaintenanceFundsErrorEnum;

import cn.hutool.core.util.ObjectUtil;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;

/**
 * 业务结果通知请求参数
 *
 * @author liangp
 * @date 2023/03/14
 */
@ApiModel(description = "业务结果通知消息")
public class ResultNotifyMessage {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "外部业务标识")
    private String serverIdentification;

    @ApiModelProperty(value = "外部业务标识")
    private String outServerIdentification;

    @ApiModelProperty(value = "受理开始时间")
    private LocalDateTime acceptTime;

    @ApiModelProperty(value = "审批意见")
    private String content;

    @ApiModelProperty(value = "办理人员ID")
    private Long operId;

    @ApiModelProperty(value = "办理人员姓名")
    private String operName;

    @ApiModelProperty(value = "步骤主键")
    private String stepId;

    @ApiModelProperty(value = "状态")
    private String status;

    @ApiModelProperty(value = "业务状态")
    private String serverStatus;

    public String getStepId() {
        return stepId;
    }

    public void setStepId(String stepId) {
        this.stepId = stepId;
    }

    public String getStatus() {
        return status;
    }

    public void setStatus(String status) {
        this.status = status;
    }

    public String getServerStatus() {
        return serverStatus;
    }

    public void setServerStatus(String serverStatus) {
        this.serverStatus = serverStatus;
    }

    public String getServerIdentification() {
        return serverIdentification;
    }

    public void setServerIdentification(String serverIdentification) {
        this.serverIdentification = serverIdentification;
    }

    public String getOutServerIdentification() {
        return outServerIdentification;
    }

    public void setOutServerIdentification(String outServerIdentification) {
        this.outServerIdentification = outServerIdentification;
    }

    public LocalDateTime getAcceptTime() {
        return acceptTime;
    }

    public void setAcceptTime(LocalDateTime acceptTime) {
        this.acceptTime = acceptTime;
    }

    public String getContent() {
        return content;
    }

    public void setContent(String content) {
        this.content = content;
    }

    public Long getOperId() {
        return operId;
    }

    public void setOperId(Long operId) {
        this.operId = operId;
    }

    public String getOperName() {
        return operName;
    }

    public void setOperName(String operName) {
        this.operName = operName;
    }

    public void checkNull() {
        if (ObjectUtil.isNull(serverIdentification)) {
            throw new ServiceException(GwjEnumUtils.getEnumConstantMsg(MaintenanceFundsErrorEnum.RESULT_NOTIFY) + "bizId为空");
        }
        if (ObjectUtil.isNull(outServerIdentification)) {
            throw new ServiceException(GwjEnumUtils.getEnumConstantMsg(MaintenanceFundsErrorEnum.RESULT_NOTIFY) + "outServerIdentification为空");
        }
        if (ObjectUtil.isNull(operId)) {
            throw new ServiceException(GwjEnumUtils.getEnumConstantMsg(MaintenanceFundsErrorEnum.RESULT_NOTIFY) + "operId为空");
        }
        if (ObjectUtil.isNull(operName)) {
            throw new ServiceException(GwjEnumUtils.getEnumConstantMsg(MaintenanceFundsErrorEnum.RESULT_NOTIFY) + "operName为空");
        }
        if (ObjectUtil.isNull(content)) {
            throw new ServiceException(GwjEnumUtils.getEnumConstantMsg(MaintenanceFundsErrorEnum.RESULT_NOTIFY) + "content为空");
        }
        if (ObjectUtil.isNull(acceptTime)) {
            throw new ServiceException(GwjEnumUtils.getEnumConstantMsg(MaintenanceFundsErrorEnum.RESULT_NOTIFY) + "acceptTime为空");
        }
    }
}
